import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/standardiztion/standardization_entity.dart';

StandardizationEntity $StandardizationEntityFromJson(Map<String, dynamic> json) {
  final StandardizationEntity standardizationEntity = StandardizationEntity();
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    standardizationEntity.createDate = createDate;
  }
  final String? expirationDate = jsonConvert.convert<String>(json['expirationDate']);
  if (expirationDate != null) {
    standardizationEntity.expirationDate = expirationDate;
  }
  final String? fileAddressUrl = jsonConvert.convert<String>(json['fileAddressUrl']);
  if (fileAddressUrl != null) {
    standardizationEntity.fileAddressUrl = fileAddressUrl;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    standardizationEntity.id = id;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    standardizationEntity.name = name;
  }
  final int? remindDay = jsonConvert.convert<int>(json['remindDay']);
  if (remindDay != null) {
    standardizationEntity.remindDay = remindDay;
  }
  final String? reviewDate = jsonConvert.convert<String>(json['reviewDate']);
  if (reviewDate != null) {
    standardizationEntity.reviewDate = reviewDate;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    standardizationEntity.status = status;
  }
  final String? type = jsonConvert.convert<String>(json['type']);
  if (type != null) {
    standardizationEntity.type = type;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    standardizationEntity.updateDate = updateDate;
  }
  return standardizationEntity;
}

Map<String, dynamic> $StandardizationEntityToJson(StandardizationEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createDate'] = entity.createDate;
  data['expirationDate'] = entity.expirationDate;
  data['fileAddressUrl'] = entity.fileAddressUrl;
  data['id'] = entity.id;
  data['name'] = entity.name;
  data['remindDay'] = entity.remindDay;
  data['reviewDate'] = entity.reviewDate;
  data['status'] = entity.status;
  data['type'] = entity.type;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension StandardizationEntityExtension on StandardizationEntity {
  StandardizationEntity copyWith({
    String? createDate,
    String? expirationDate,
    String? fileAddressUrl,
    String? id,
    String? name,
    int? remindDay,
    String? reviewDate,
    int? status,
    String? type,
    String? updateDate,
  }) {
    return StandardizationEntity()
      ..createDate = createDate ?? this.createDate
      ..expirationDate = expirationDate ?? this.expirationDate
      ..fileAddressUrl = fileAddressUrl ?? this.fileAddressUrl
      ..id = id ?? this.id
      ..name = name ?? this.name
      ..remindDay = remindDay ?? this.remindDay
      ..reviewDate = reviewDate ?? this.reviewDate
      ..status = status ?? this.status
      ..type = type ?? this.type
      ..updateDate = updateDate ?? this.updateDate;
  }
}
